<template>
  <ul class="list">
    <li v-for="item in list" @click="getTitleHandle({title:item.title})">{{item.title}}</li>
  </ul>
</template>

<script>
  import {mapState,mapGetters,mapActions,mapMutations} from 'vuex'
  export default {
    props:["data"],
    methods:{
      ...mapMutations({
        getTitleHandle:'changeTitle'
      })
     /* getTitleHandle(title){
        //触发父组件中的自定义事件
        this.$emit('changeTitle',title)

      }*/

    },
    ...mapActions({
      created:'getListAction'
    }),
    computed:{

      ...mapState({ // 获取子模块的值
        "list":state=>state.selectModule.list
      })
    }


  }
</script>
